package cn.qio.event;

import java.nio.channels.SelectionKey;

import cn.qio.channel.session.ChannelSession;

/**
 * 事件封装对象
 * 
 * @author chenhua
 *
 */
public class Event {

	private final EventType eventType;

	private final ChannelSession channelSession;

	private SelectionKey selectKey;

	private Object data;

	public Event(EventType eventType, ChannelSession channelSession, Object obj) {
		super();
		this.eventType = eventType;
		this.channelSession = channelSession;
		this.data = obj;
	}

	public Event(EventType eventType, ChannelSession channelSession, Object obj, SelectionKey selectKey) {
		super();
		this.eventType = eventType;
		this.channelSession = channelSession;
		this.data = obj;
		this.selectKey = selectKey;
	}
	
	
	public void setSelectKey(SelectionKey selectKey) {
		this.selectKey = selectKey;
	}

	public SelectionKey getSelectKey() {
		return selectKey;
	}

	public EventType getEventType() {
		return eventType;
	}

	public ChannelSession getChannelSession() {
		return channelSession;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

}
